package com.cade.agriculturemall.view.home.promotion;

import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.cade.agriculturemall.R;
import com.cade.agriculturemall.base.BaseActivity;
import com.cade.agriculturemall.model.GoodsDetailEntity;

import java.util.List;

/**
 * Created by Administrator on 2018/4/28 0028.
 */

public class PromotionActivity extends BaseActivity<PromotionContract.IPresenter> implements PromotionContract.IView {
    private RecyclerView recyclerView;
    private PromotionAdapter mAdapter = new PromotionAdapter(this);

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setupToolbar(true);
        setContentView(R.layout.activity_promotion);
        recyclerView = (RecyclerView) findViewById(R.id.promotion_recyclerview);
//        recyclerView.setLayoutManager(new GridLayoutManager(this, 2));
//        recyclerView.setAdapter(mAdapter);
    }

    @Override
    public void setupView() {

    }

    @Override
    public void setupEvent() {

    }

    @Override
    public void setupData() {
        mPresenter.downLoadList();
    }

    @Override
    public PromotionContract.IPresenter setupPresenter() {
        return new PromotionPresenter(this);
    }

    @Override
    public void getList(List<GoodsDetailEntity> mList) {
        mAdapter.setList(mList);
        mAdapter.notifyDataSetChanged();
    }
}
